-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: pass through config_settings
coming from build frontends
#122
Conversation
4709d49
to
c662d4a
Compare
Thanks for opening this. Unfortunately, it is not that simple 😅. Blindly passing the options will cause breakage if you mess with any of the options we rely on. That said, the
Well, we do multiple meson calls! Currently, we do |
I think the only option you rely on is
Only the |
IIRC changing the prefix should only be an issue in the heuristics code paths, but yeah, we do set that. We also use
Yes, but I would want to allow users to pass In |
These will simply stack, so passing your native file as the very last option would work and override any settings the user specified. TBH I'd want to configure the python installation being compiled for 🤷♂️ but that might be challenging for build requirements. |
Yep, though the UX of quietly overriding it is not great, so we'd probably want to try detecting those situations and either throw an error or a warning. Is there anything fancy in the syntax that would make parsing not trivial?
Well, that goes against PEP 517 😅. For cross builds, I have thrown around the idea of defining a new hook specifically for that, so that build backends may support that use case correctly. That needs a new PEP though, so I am not sure when I'll get around to do it. |
The file must be a valid configparser file, but the RHS of a binaries entry can have a limited amount of meson.build syntax.
Since you don't actually care about the contents, only whether the key exists, you can simply load it as a configparser file, and check the names of binaries being set in |
It's indeed the case that the vast majority of options need to go to The optimization and debug levels we use can be overridden, that requires custom handling.
I'd throw an error for
This isn't a great approach. Each time someone needs to pass something else to |
@FFY00 and I had a chat about this PR on Friday. One issue @FFY00 pointed out was that if any new options are added to the I now understand better the alternative he had in mind: explicitly letting the user define which options go to The flip side of that coin is that the UX is going to be more verbose. It's not clear exactly what that UX should be yet. The
So likely something like:
There's a couple of different ways of spelling this (e.g. Opinions pro or con this idea? If separate setup/build/install stages, preferred way of spelling it? |
The install stage does have some fine-tuning you can do to it, e.g. you can define a subset of tags to be installed, or skip subprojects. I'm not sure how useful either one is for wheels though. There's also --strip, but that duplicates the setup option of the same name. In general, it seems plausible that further options might be added. In comparison, the build stage is just "run ninja". It is both more and less interesting -- there are no options to fine-tune the resulting wheel, but several options to control the resources used (parallelism, etc.) But, the build stage is also probably best controlled by e.g. |
It turns out
There's one missing, Would make sense to adopt that I think. |
|
Ah, good to know, thanks. Are you still happy with how that interface works in |
I think the interface makes sense given the constraints of the PEP517 interface, although renaming them to |
Having a way to specify default options in the pyproject.toml would also be nice. Not sure if that has been taken into account yet. Passing options on the command line would override the defaults in a perfect world I think |
That may be helpful for clarity. It makes very long lines even longer, but overall that is still a good tradeoff perhaps.
That is gh-108. It seems reasonable, and the issue submitter there also explains why it must be in |
I wasn't referring to |
Closing in favor of #167. |
Closes gh-54
This came up when Spack tried to package SciPy 1.9.0 (see spack/spack#31810). It turned out that most of the infra is already there,
config_settings
simply needed plumbing through. I have tested that this works for SciPy, when building a wheel against a non-default BLAS/LAPACK.@FFY00 in gh-54 you said "I am struggling to decide on the design", but as far as I can tell there is no UI design aspect here? This is up to build front-ends, all a backend has to do is pass on the
config_settings
dict that is passed intobuild_sdist
andbuild_wheel
?I haven't added tests yet, I thought I'd first put this up for feedback.
EDIT:
config_settings
is part of PEP 517: https://peps.python.org/pep-0517/#config-settings